﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Knowledge.aspx.cs" Inherits="Touch2Like.Web.Admin.Manage.Knowledge" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link href="/img/jquery.fancybox.css" rel="stylesheet" type="text/css" />
    <link href="/css/user.css" rel="stylesheet" type="text/css" />
    <link href="/css/user_content.css" rel="stylesheet" type="text/css" />
    <script src="/js/jquery.js" type="text/javascript"></script>
    <script src="/js/flipcounter.js" type="text/javascript"></script>
    <script src="/js/jquery.fancybox.js" type="text/javascript"></script>
    <link href="/css/smoothness/jquery-ui-1.9.1.custom.min.css" rel="stylesheet" type="text/css" />
    <script src="/js/jquery-ui-1.9.1.custom.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            $("#btn_AddKnowledge").click(function () {
                $("#ifrEditTag").attr("src", "../Popup/AddKnowledge.aspx");
                $("#dialog").dialog({ height: 500, width: 550, modal: true, resizable: false, minWidth: 550, minHeight: 500, maxWidth: 550, maxHeight: 500 });
            });
            $(".edititem").click(function () {
                $("#ifrEditTag").attr("src", "../Popup/AddKnowledge.aspx?ListID=" + $(this).attr("item-value"));
                $("#dialog").dialog({ height: 500, width: 550, modal: true, resizable: false, minWidth: 550, minHeight: 500, maxWidth: 550, maxHeight: 500 });
            });
            $("#cb_All").click(function () {
                if ($(this).attr("checked")) {
                    $(".cb_Single :checkbox").attr("checked", true);
                } else {
                    $(".cb_Single :checkbox").attr("checked", false);
                }
            });
        });

        function hideDialog() {
            $("#dialog").dialog("close");
        }

        function ConfirmMsg(msg) {
            if (confirm(msg)) {
                return true;
            } else {
                event.cancelBubble = true;
                event.returnValue = false;
                return false;
            }
        }

        function ClickFormButton(btnid) {
            $("#" + btnid).click();
        }

        function ClickButton(btnid) {
            if ($("#ifrEditTag")[0].contentWindow) {
                $("#ifrEditTag")[0].contentWindow.IframeClickButton(btnid)
            }
        }
    </script>
    <style type="text/css">
        .ui-dialog
        {
            padding: 0px;
        }
        .ui-dialog-titlebar
        {
            background: #ecf0f4 -webkit-linear-gradient(#fff, #ecf0f4);
            border: 0px solid #aaaaaa;
            height: 30px;
            line-height: 30px;
            border-bottom: 1px solid #ced4dc;
        }
        .ui-dialog-title
        {
            color: #475b6f;
            font-size: 14px;
            text-align: center;
        }
        th
        {
            text-align: center;
        }
        td
        {
            padding: 3px;
        }
        /*.ui-dialog{padding:0px;}
    .ui-dialog .ui-dialog-titlebar{}*/
    </style>
</head>
<body style="overflow: hidden;">
    <div id="dialog" title="Add Knowledge" style="display: none; padding: 0px;
        background: #ecf0f4;">
        <div style="height: 385px;">
            <iframe id="ifrEditTag" src="../Popup/AddKnowledge.aspx" frameborder="0" style="width: 550px;
                height: 385px;"></iframe>
        </div>
        <div class="modal-footer" style="text-align: right; padding: 15px;">
            <button name="confirm" class="button medium blue" onclick="ClickButton('btn_Submit')">
                <span>Save</span></button>
            <button name="close_modal" class="button medium grey" onclick="ClickButton('btn_Cancel')">
                <span>Cancel</span></button>
        </div>
    </div>
    <form id="form1" runat="server">
    <div class="detail-container">
        <div class="header">
            <h3>
                Knowledge Manager
            </h3>
        </div>
        <div class="content">
            <div class="section-wrap">
                <h3>
                    Knowledges&nbsp;|&nbsp;
                    <button class="button medium blue" id="btn_AddKnowledge" type="button">
                        <span>Add Knowledge</span></button>
                    <button class="button medium blue" type="button" onclick="ClickFormButton('btn_Delete')">
                        <span>Delete</span></button>
                    <asp:Button ID="btn_Delete" runat="server" CssClass="Submit" Text="Delete" OnClientClick="return ConfirmMsg('Are you sure you want to delete these items.');"
                        OnClick="btn_Delete_Click" Style="display: none" />
                </h3>
                <div class="container">
                    <div>
                        <asp:GridView ID="GridView_Knowledge" runat="server" AutoGenerateColumns="false"
                            AllowPaging="true" AllowSorting="true" PageSize="20" OnPageIndexChanging="GridView_Knowledge_PageIndexChanging"
                            OnSorting="GridView_Knowledge_Sorting" Width="640px" RowStyle-BorderStyle="Solid"
                            RowStyle-BorderWidth="1px" RowStyle-BorderColor="#e4e6eb" BorderWidth="1px" HeaderStyle-BorderWidth="1px"
                            HeaderStyle-BorderColor="#e4e6eb" HeaderStyle-BorderStyle="Solid" CellSpacing="2"
                            CellPadding="3" HeaderStyle-BackColor="#EEF0F4" HeaderStyle-Height="30px" HeaderStyle-HorizontalAlign="Center">
                            <Columns>
                                <asp:TemplateField SortExpression="ListID" HeaderStyle-Width="13">
                                    <ItemTemplate>
                                        <asp:CheckBox ID="cb_ListID" runat="server" CssClass="cb_Single" />
                                        <asp:HiddenField ID="tb_ListID" runat="server" Value='<%#Eval("ListID") %>' />
                                    </ItemTemplate>
                                    <HeaderTemplate>
                                        <input type="checkbox" id="cb_All" />
                                    </HeaderTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Title" SortExpression="Title">
                                    <ItemTemplate>
                                        <%#Eval("Title") %>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Content" SortExpression="Content">
                                    <ItemTemplate>
                                        <%#Eval("Content") %>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderStyle-Width="65">
                                    <ItemTemplate>
                                        <button class="button medium grey edititem" item-value='<%#Eval("ListID") %>' type="button">
                                            <span>Edit</span></button>
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                        </asp:GridView>
                    </div>
                </div>
            </div>
        </div>
    </div>
    </form>
</body>
</html>
